<include file="__PUBLIC__/header"/>
<div class="page-container">
    <!--菜单-->
    <div class="cl pd-5 bg-1 bk-gray mt-10 mb-10">
        <span class="l">
            <a href="javascript:;" onclick="qz_layer_open('添加栏目','{|U:'add'}')" class="btn btn-secondary radius"><i class="Hui-iconfont">&#xe600;</i> 新增</a>
            <a href="javascript:;" onclick="ajax_req('{|U:'updateCache'}')" class="btn btn-default radius ml-5"><i class="iconfont icon-qingchuhuancun"></i> 更新栏目缓存</a>
        </span>
        <span class="r" style="line-height:1.6em;margin-top:3px"></span>
    </div>
    <!--列表-->
    <form class="form form-horizontal" id="form" action="{|U:'updateOrder'}" method="post">
    <table class="table table-border table-bordered table-bg mt-10 table-sort" id="table">
        <thead>
        <tr class="text-c">
            <th>排序</th>
            <th>ID</th>
            <th>栏目名称</th>
            <th>类型</th>
            <th>模型</th>
            <th width="100">操作</th>
        </tr>
        </thead>
        <tbody>
        <list from="$category" name="$c">
            <tr class="text-c">
            <td>
                <input type="text" size="1" class="input-text" value="{$c.catorder}" name="list_order[{$c.cid}]"/>
            </td>
            <td>{$c.cid}</td>
            <td>
                <if value="$c.pid eq 0">
                    <strong>{$c._name}</strong>
                    <else/>
                    {$c._name}
                </if>
            </td>
            <td>{$c.cat_type_name}</td>
            <td>{$c.model_name}</td>
            <td>
                <a title="编辑" href="javascript:;" onclick="qz_layer_open('编辑分类','{|U:'edit',array('cid'=>$c['cid'])}')" class="label label-primary radius" ><i class="Hui-iconfont">&#xe6df;</i></a>
                <a title="删除" href="javascript:;" onclick="del_forever(this,'{$c['cid']}','{|U:'del'}')"
                   class="label label-danger radius" ><i class="Hui-iconfont">&#xe6e2;</i></a>
            </td>
            </tr>
        </list>
    </tbody>
    </table>
        <br>
        <button type="submit" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe675;</i> 排序</button>
    </form>
</div>
<include file="__PUBLIC__/footer"/>
<script>
    $(function () {
        //表单提交
        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret) {
                ajax_progress(ret);
            }
        });
    })
</script>
</body>
</html>